const { defineConfig } = require('@vue/cli-service')
const name = process.env.VUE_APP_TITLE
module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  lintOnSave: process.env.NODE_ENV === 'development',
  devServer: {
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: process.env.TARGET,
        changeOrigin: true,
        pathRewrite: {
          ['^' + process.env.VUE_APP_BASE_API]: ''
        }
      },
      [process.env.VUE_APP_IMG_BASE_API]: {
        target: process.env.IMG_TARGET,
        changeOrigin: true,
        pathRewrite: {
          // 'xiaomi-images' --> ''
          ['^' + process.env.VUE_APP_IMG_BASE_API]: ''
        }
      }
    }
  },
  configureWebpack: {
    name: name,
    plugins: []
  }
})
